<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<title>用户列表</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/basic.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/login.css">

		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="${basePath}resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/admin_user_list.js?t=20170604"></script>
	</head>
	<body ng-app="myApp" ng-controller="AdminUserListController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
			<h1>用户列表</h1>
		</div>
		<div id="container">
			<form onsubmit="return false;" name="loginForm" novalidate>
				<p>
					<label class="label label-length" for="searchUsername">根据用户名查询</label>
					<input type="text" name="searchUsername" ng-model="searchUsername" placeholder="用户名" required />
					<input type="submit" class="btn btn-primary" name="searchBtn" id="searchBtn" value="查询" ng-click="search()" ng-disabled="loginForm.$invalid"/>
					<input type="button" class="btn btn-primary" name="refreshBtn" id="refreshBtn" value="刷新" ng-click="refresh()" ng-disabled="1==2"/>
				</p>

				<div>
					<table class="table">
						<thead>
							<tr>
								<th>用户ID</th>
								<th>用户名</th>
								<th>真实姓名</th>
								<th>性别</th>
								<th>手机</th>
								<th>email</th>
								<th>身份</th>
								<th>详情</th>
								<th>删除</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="x in users">
								<td>{{x.userId}}</td>
								<td>{{x.username}}</td>
								<td>{{x.truename}}</td>
								<td>{{x.gender | genderFilter : x.gender}}</td>
								<td>{{x.phone}}</td>
								<td>{{x.email}}</td>
								<td>{{x.type | userType : x.type}}</td>
								<td><a href="${basePath}admin/user/detail/{{x.userId}}">详情</a></td>
								<td><button type="" ng-click="delUser(x.userId,x.username)">删除</button></td>
							</tr>
						</tbody>
					</table>
				</div>
			</form>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>